Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

19701 try to come up with a solution where html tags in translations are not reliant on the order #21938

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

vraja-pro
Copy link
Contributor

@vraja-pro vraja-pro commented Dec 31, 2024

Context

  • We want to catch translation errors from breaking our UI.

Summary

This PR can be summarized in the following changelog entry:

  • Implements helper function to catch errors in translations.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes Try to come up with a solution where HTML tags in translations are not reliant on the order

@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Dec 31, 2024

This comment was marked as outdated.

3 similar comments

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@coveralls
Copy link

coveralls commented Dec 31, 2024

Pull Request Test Coverage Report for Build 91da0f367dfc4b28a114602b154580fcc70de6b1

Details

  • 0 of 6 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on 19701-try-to-come-up-with-a-solution-where-html-tags-in-translations-are-not-reliant-on-the-order at 33.37%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/settings/routes/site-basics.js 0 1 0.0%
packages/js/src/helpers/i18n.js 0 5 0.0%
Totals Coverage Status
Change from base Build 9c66956756c0900e29fb6645e4308dfb47898de1: 33.4%
Covered Lines: 2033
Relevant Lines: 5789

💛 - Coveralls

@leonidasmi leonidasmi changed the base branch from trunk to feature/plugin-fixes January 2, 2025 09:55
Copy link
Member

@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR 🏗️

Edit: I think the changelog entries should be user facing. Maybe not the technical one that is there now. But maybe improvement that translations will now fall back to English?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you see in the comments you got, the helpers package should not be added to.
The reason for this is that we don't want to maintain a random assortment of helpers in a helper package. If there is a need for a overarching package. You could create a specific one. The smaller and targeted, the less maintenance it needs?

Why did you add it to helpers in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking it would be easier to use in the rest of the addon/premium

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easier than what?

Copy link
Contributor Author

@vraja-pro vraja-pro Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to the helpers folder, but I'm thinking we should have a separate package or fix the issue at the source( fixing createInterpolateElement).

packages/helpers/tests/i18nCreateInterpolateElementTest.js Outdated Show resolved Hide resolved
packages/helpers/tests/i18nCreateInterpolateElementTest.js Outdated Show resolved Hide resolved
packages/helpers/tests/i18nCreateInterpolateElementTest.js Outdated Show resolved Hide resolved
packages/helpers/tests/i18nCreateInterpolateElementTest.js Outdated Show resolved Hide resolved
packages/helpers/tests/i18nCreateInterpolateElementTest.js Outdated Show resolved Hide resolved
packages/helpers/src/i18n-create-interpolate-element.js Outdated Show resolved Hide resolved
packages/helpers/src/i18n-create-interpolate-element.js Outdated Show resolved Hide resolved
packages/helpers/src/i18n-create-interpolate-element.js Outdated Show resolved Hide resolved
packages/helpers/package.json Outdated Show resolved Hide resolved
@igorschoester igorschoester changed the base branch from feature/plugin-fixes to trunk January 7, 2025 10:44
Also implements it in the site basic page

tests for i18nCreateInterpolateElement

fix lint

restore testURL

remove jsdom
@vraja-pro vraja-pro force-pushed the 19701-try-to-come-up-with-a-solution-where-html-tags-in-translations-are-not-reliant-on-the-order branch from 370ff4d to e258374 Compare January 14, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try to come up with a solution where HTML tags in translations are not reliant on the order
3 participants